﻿using System;
using SharpDX;
using SharpDX.Toolkit;

namespace BoatNGoat
{
    /// <summary>
    /// Updateable camera controller.
    /// </summary>
    interface ICameraController : IUpdateable
    {
        /// <summary>
        /// The Camera to control.
        /// </summary>
        Camera Camera { set; }
    }


    /// <summary>
    /// Simple camera that flies over the landscape like a poodle in a hurricane.
    /// </summary>
    class WhoooshCamera : ICameraController
    {
        public Camera Camera { set; private get; }

        private double _time;

        public void Update(GameTime gameTime)
        {
            if (Camera == null) return;

            _time += Math.PI/60;

            Camera.ViewCentre += new Vector2(0.05f, 0.05f);
            Camera.Zoom = 1 + (0.5*Math.Sin(_time));

        }
    }
}